import { RegisterComponent } from "@feng3d/ecs";
import { PointLight } from "../../thirdparty/three/imports";
import { Light3D } from "./Light3D";

declare module "@feng3d/ecs"
{
    interface ComponentMap { PointLight3D: PointLight3D; }
}

/**
 * 3D点光源，包装`three`中`PointLight`
 */
@RegisterComponent({ name: 'PointLight3D' })
export class PointLight3D extends Light3D
{
    _light: PointLight = new PointLight();

    get distance()
    {
        return this._light.distance;
    }
    set distance(v)
    {
        this._light.distance = v;
    }

    get decay()
    {
        return this._light.decay;
    }
    set decay(v)
    {
        this._light.decay = v;
    }
}
